<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>Mon compte</title>
        <meta name="keywords" content="" />
        <meta name="description" content="" />
        <link rel="stylesheet" type="text/css" href="default.css" />
        <script type="text/javascript" src="jquery.js"></script>
        <script type="text/javascript" src="scripts.js"></script>
    </head>
    <body>
        <div id="upbg"></div>
        <div id="outer">

            <?php
            include 'header.php';
            ?>
            <?php
            include 'login.php';
            include 'menu.php';
            ?>
            <div id="content">
                <?php
                include_once 'connectBDD.php';
                $result = mysql_query("SELECT * FROM user where login ='" . $_SESSION['login'] . "'");
                 include 'utils/verificateurDate.class.php';
                
                while ($row = mysql_fetch_assoc($result)) {
                    echo "<div id='blockInfoPers'>
                            <div class='barreChoix'>
                            <ul>
                                <a href='javascript:ajaxProfil();'><li><img src='images/id_card.png' />Profil</li></a>
                                <a href='javascript:ajaxMessagerie();'><li><img src='images/mail-32.png' />Messagerie</li></a>
                                <a href='javascript:ajaxListEvenements();'><li><img src='images/Event-search-32.png'/>Evenements</li></a>
                            </ul>
                            </div>
                        <div id='infoPers'>
                            <div id='infoPers_gauche'>
                                <div class='sousTitreInfo'>Nom
                                    <span id='modifierInfo' >
                                        <a id='modifNom' href=\"javascript:modifierInfo('Nom')\">modifier</a>
                                        <a id='cacherNom' href=\"javascript:cacher('Nom')\">cacher</a>
                                    </span>
                                </div>
                                <div id='infoNom'>" . $row['last_name'] . "</div>
                                <div id='formNom'>
                                    <form action='' method='post'>
                                    <label for='nom'>Nom : </label><input type='text' name='nom' value='' id='inputNom'/><br />
                                    <input type='submit' value='enregistrer' name='bouton'/>
                                   </form>
                                   <span class='error' id='error_1' style='display:none'> Remplissez correctement le champs</span>
                                   <span class='success' id='success_1' style='display:none'> Modifications enregistrées</span>
                                </div>

                                <div class='sousTitreInfo'>Prenom
                                    <span id='modifierInfo' >
                                        <a id='modifPrenom'href=\"javascript:modifierInfo('Prenom')\">modifier</a>
                                        <a id='cacherPrenom' href=\"javascript:cacher('Prenom')\">cacher</a>
                                    </span>
                                </div>
                                <div id='infoPrenom'>" . $row['first_name'] . "</div>
                                <div id='formPrenom'>
                                    <form action='' method=\"post\">
                                        <label for='prenom'>Prenom : </label><input type='text' name='prenom' value='' id='inputPrenom'/><br />
                                        <input type='submit' value='enregistrer' name='bouton'/>
                                    </form>
                                    <span class='error' id='error_2' style='display:none'> Remplissez correctement le champs</span>
                                    <span class='success' id='success_2' style='display:none'> Modifications enregistrées</span>
                                </div>

                                <div class='sousTitreInfo'>Date de naissance
                                    <span id='modifierInfo' >
                                        <a id='modifDateNaiss' href=\"javascript:modifierInfo('DateNaiss')\">modifier</a>
                                        <a id='cacherDateNaiss' href=\"javascript:cacher('DateNaiss')\">cacher</a>
                                    </span>
                                </div>
                                <div id='infoDateNaiss'>" . date_format(new DateTime($row['birthdate']), 'd-m-Y') . "</div>
                                <div id='formDateNaiss'>
                                    <form action=\"monCompte.php\" method=\"post\">
                                    <label for='datenaiss'>Date de naissance : </label><input type='text' name='datenaiss' value='' id='inputDateNaiss'/><br />
                                    <input type='submit' value='enregistrer' name='bouton'/>
                                    </form>
                                    <span class='error' id='error_3' style='display:none'> Remplissez correctement le champs</span>
                                    <span class='success' id='success_3' style='display:none'> Modifications enregistrées</span>
                                </div>

                                <div class='sousTitreInfo'>Mail
                                    <span id='modifierInfo'>
                                        <a id='modifMail' href=\"javascript:modifierInfo('Mail')\">modifier</a>
                                        <a id='cacherMail' href=\"javascript:cacher('Mail')\">cacher</a>
                                    </span>
                                </div>
                                <div id='infoMail'>" . $row['mail'] . "</div>
                                <div id='formMail'>
                                    <form action=\"monCompte.php\" method=\"post\">
                                    <label for='mail'>Mail : </label><input type='text' name='mail' value='' id='inputMail'/><br />
                                    <input type='submit' value='enregistrer' name='bouton' />
                                    </form>
                                    <span class='error' id='error_4' style='display:none'> Remplissez correctement le champs</span>
                                    <span class='success' id='success_4' style='display:none'> Modifications enregistrées</span>
                                </div>
                            </div>
                            <div id='avatar'>
                            <a href='editImageProfile.php'>
                                <img src='" . $row['avatar_path'] . "' height='300px' width='290px'/>
                            </a>
                            </div>
                            </div>";
                }

                mysql_free_result($result);
                ?>
            </div>
            <?php
            include 'footer.php';
            ?>

        </div>

    </body>
</html>
